<?php

Route::group(['namespace' => 'Admin'], function () {
    Route::any('/','AuthController@login')->name('admin.auth.login');//登录
    Route::group(['prefix' => 'auth'], function(){
        Route::get('logout','AuthController@logout')->name('admin.auth.logout');//退出
        Route::get('captcha','AuthController@captcha')->name('admin.auth.captcha');//验证码
    });
    //登录权限
    Route::group(['middleware' => ['auth:admin','manage.menu','manage.access']], function(){
        //首页
        Route::get('/main','IndexController@index')->name('admin.index.index');//登录
        //管理员
        Route::group(['prefix' => 'manage'], function(){
            Route::get ('/','ManageController@index')->name('admin.manage.index');//首页
            Route::get ('/list','ManageController@list')->name('admin.manage.list');//列表
            Route::post('/update', 'ManageController@update')->name('admin.manage.update');//更新
            Route::post('/destroy', 'ManageController@destroy')->name('admin.manage.destroy');//删除
            Route::post('/lock', 'ManageController@lock')->name('admin.manage.lock');//锁定
            Route::post('/active', 'ManageController@active')->name('admin.manage.active');//激活
        });
        //角色
        Route::group(['prefix' => 'role'], function(){
            Route::get ('/','RoleController@index')->name('admin.role.index');//首页
            Route::get ('/list','RoleController@list')->name('admin.role.list');//列表
            Route::post('/update', 'RoleController@update')->name('admin.role.update');//更新
            Route::post('/destroy', 'RoleController@destroy')->name('admin.role.destroy');//删除
            Route::post('/lock', 'RoleController@lock')->name('admin.role.lock');//锁定
            Route::post('/active', 'RoleController@active')->name('admin.role.active');//激活
            Route::get ('/access', 'RoleController@access')->name('admin.role.access');//授权
            Route::post('/store', 'RoleController@store')->name('admin.role.store');//授权更新
        });

        //用户
        Route::group(['prefix' => 'user'], function(){
            Route::get ('/','UserController@index')->name('admin.user.index');//首页
            Route::get ('/list','UserController@list')->name('admin.user.list');//列表
            Route::get ('/edit','UserController@edit')->name('admin.user.edit');//编辑（详情）
            Route::post('/update', 'UserController@update')->name('admin.user.update');//更新
            Route::post('/destroy', 'UserController@destroy')->name('admin.user.destroy');//删除
            Route::post('/lock', 'UserController@lock')->name('admin.user.lock');//拒绝
            Route::post('/active', 'UserController@active')->name('admin.user.active');//激活
            Route::post('/close', 'UserController@close')->name('admin.user.close');//锁定
            Route::get('/exports', 'UserController@exports')->name('admin.user.exports');//导出excel
        });

        //等级
        Route::group(['prefix' => 'userLevel'], function(){
        	Route::get ('/','LevelController@index')->name('admin.userLevel.index');//首页
        	Route::get ('/list','LevelController@list')->name('admin.userLevel.list');//列表       	
        	Route::post('/update', 'LevelController@update')->name('admin.userLevel.update');//更新
        	Route::post('/destroy', 'LevelController@destroy')->name('admin.userLevel.destroy');//删除        	
        });
        
        //网站配置
        Route::group(['prefix' => 'config'], function(){
            Route::get ('/','ConfigController@index')->name('admin.config.index');//首页
            Route::post('/update', 'ConfigController@update')->name('admin.config.update');//更新
        });
        
        //城市管理
        Route::group(['prefix' => 'areas'], function(){
            Route::get ('/','AreasController@index')->name('admin.areas.index');//首页
            Route::get ('/list','AreasController@list')->name('admin.areas.list');//列表
            Route::post('/update', 'AreasController@update')->name('admin.areas.update');//更新
            Route::post('/destroy', 'AreasController@destroy')->name('admin.areas.destroy');//删除
        });
        //任务分类
        Route::group(['prefix' => 'category'], function(){
            Route::get ('/','CategoryController@index')->name('admin.category.index');//首页
            Route::get ('/list','CategoryController@list')->name('admin.category.list');//列表
            Route::post('/update', 'CategoryController@update')->name('admin.category.update');//更新
            Route::post('/destroy', 'CategoryController@destroy')->name('admin.category.destroy');//删除
        });
        //行业
        Route::group(['prefix' => 'trade'], function(){
        	Route::get ('/','TradeController@index')->name('admin.trade.index');//首页
        	Route::get ('/list','TradeController@list')->name('admin.trade.list');//列表
        	Route::post('/update', 'TradeController@update')->name('admin.trade.update');//更新
        	Route::post('/destroy', 'TradeController@destroy')->name('admin.trade.destroy');//删除
        });
        //广告位
        Route::group(['prefix' => 'adsense'], function(){
            Route::get ('/','AdsenseController@index')->name('admin.adsense.index');//首页
            Route::get ('/list','AdsenseController@list')->name('admin.adsense.list');//列表
            Route::post('/update', 'AdsenseController@update')->name('admin.adsense.update');//更新
            Route::post('/destroy', 'AdsenseController@destroy')->name('admin.adsense.destroy');//删除
        });
        //广告
        Route::group(['prefix' => 'ad'], function(){
            Route::get ('/','AdController@index')->name('admin.ad.index');//首页
            Route::get ('/list','AdController@list')->name('admin.ad.list');//列表
            Route::post('/update', 'AdController@update')->name('admin.ad.update');//更新
            Route::post('/destroy', 'AdController@destroy')->name('admin.ad.destroy');//删除
            Route::post('/lock', 'AdController@lock')->name('admin.ad.lock');//锁定
            Route::post('/active', 'AdController@active')->name('admin.ad.active');//激活
        });
        
        //投诉建议
        Route::group(['prefix' => 'feedback'], function(){
            Route::get ('/','FeedbackController@index')->name('admin.feedback.index');//首页
            Route::get ('/list','FeedbackController@list')->name('admin.feedback.list');//列表
            Route::get ('/edit','FeedbackController@edit')->name('admin.feedback.edit');//编辑（详情）
            Route::post('/update', 'FeedbackController@update')->name('admin.feedback.update');//更新
            Route::post('/destroy', 'FeedbackController@destroy')->name('admin.feedback.destroy');//删除
            Route::post('/lock', 'FeedbackController@lock')->name('admin.feedback.lock');//锁定
            Route::post('/active', 'FeedbackController@active')->name('admin.feedback.active');//激活
        });

        //文章
        Route::group(['prefix' => 'article'], function(){
            Route::get ('/','ArticleController@index')->name('admin.article.index');//首页
            Route::get ('/list','ArticleController@list')->name('admin.article.list');//列表
            Route::get ('/edit','ArticleController@edit')->name('admin.article.edit');//编辑（详情）
            Route::post('/update', 'ArticleController@update')->name('admin.article.update');//更新
            Route::post('/destroy', 'ArticleController@destroy')->name('admin.article.destroy');//删除
            Route::post('/lock', 'ArticleController@lock')->name('admin.article.lock');//拒绝
            Route::post('/active', 'ArticleController@active')->name('admin.article.active');//通过
        });
        //文档分类
        Route::group(['prefix' => 'word-category'], function(){
            Route::get ('/','WordCategoryController@index')->name('admin.wcate.index');//首页
            Route::get ('/list','WordCategoryController@list')->name('admin.wcate.list');//列表
            Route::post('/update', 'WordCategoryController@update')->name('admin.wcate.update');//更新
            Route::post('/destroy', 'WordCategoryController@destroy')->name('admin.wcate.destroy');//删除
        });
        //文档
        Route::group(['prefix' => 'word'], function(){
            Route::get ('/','WordController@index')->name('admin.word.index');//首页
            Route::get ('/list','WordController@list')->name('admin.word.list');//列表
            Route::get ('/edit','WordController@edit')->name('admin.word.edit');//编辑（详情）
            Route::post('/update', 'WordController@update')->name('admin.word.update');//更新
            Route::post('/destroy', 'WordController@destroy')->name('admin.word.destroy');//删除
            Route::post('/lock', 'WordController@lock')->name('admin.word.lock');//锁定
            Route::post('/active', 'WordController@active')->name('admin.word.active');//激活
        });


        //任务类别
        Route::group(['prefix' => 'types'], function(){
            Route::get ('/','TypesController@index')->name('admin.types.index');//首页
            Route::get ('/list','TypesController@list')->name('admin.types.list');//列表
            Route::post('/update', 'TypesController@update')->name('admin.types.update');//更新
            Route::post('/destroy', 'TypesController@destroy')->name('admin.types.destroy');//删除
        });

        //需求列表
        Route::group(['prefix' => 'demand'], function(){
            Route::get ('/','DemandController@index')->name('admin.demand.index');//首页
            Route::get ('/list','DemandController@list')->name('admin.demand.list');//列表
            Route::get ('/edit','DemandController@edit')->name('admin.demand.edit');//编辑（详情）
            Route::post('/update', 'DemandController@update')->name('admin.demand.update');//更新
            Route::post('/destroy', 'DemandController@destroy')->name('admin.demand.destroy');//删除
            Route::post('/lock', 'DemandController@lock')->name('admin.demand.lock');//锁定
            Route::post('/active', 'DemandController@active')->name('admin.demand.active');//激活
            Route::get('/userlist', 'DemandController@user_list')->name('admin.demand.user_list');//参与投标供应商
            Route::post('/storeupdate', 'DemandController@store_update')->name('admin.demand.store_update');//指定投标供应商
            Route::post('/setrcommend', 'DemandController@setrcommend')->name('admin.demand.setrcommend');//指定投标供应商
            Route::get('/exports', 'DemandController@exports')->name('admin.demand.exports');//导出excel
        });
        
        //任务记录
        Route::group(['prefix' => 'bid'], function(){
            Route::get ('/','BidLogController@index')->name('admin.bid.index');//首页
            Route::get ('/list','BidLogController@list')->name('admin.bid.list');//列表
            Route::post('/active', 'BidLogController@active')->name('admin.bid.active');//激活
            Route::post('/lock', 'BidLogController@lock')->name('admin.bid.lock');//驳回
            Route::post('/pay', 'BidLogController@pay')->name('admin.bid.pay');//完成订单
            Route::post('/destroy', 'BidLogController@destroy')->name('admin.bid.destroy');//删除
            Route::get('/edit', 'BidLogController@edit')->name('admin.bin.edit');//删除
            Route::get('/exports', 'BidLogController@exports')->name('admin.bin.exports');//删除
            														
        });

        //提现管理
        Route::group(['prefix' => 'cash-out'], function(){
            Route::get ('/','CashOutController@index')->name('admin.cash.index');//首页
            Route::get ('/list','CashOutController@list')->name('admin.cash.list');//列表
            Route::get('/edit', 'CashOutController@edit')->name('admin.cash.edit');//查看
            Route::post('/active', 'CashOutController@active')->name('admin.cash.active');//审核
            Route::post('/update', 'CashOutController@update')->name('admin.cash.update');//修改
            Route::post('/destroy', 'CashOutController@destroy')->name('admin.cash.destroy');//删除
            Route::get('/exports', 'CashOutController@exports')->name('admin.cash.exports');//导出
        });

        //余额记录
        Route::group(['prefix' => 'surplus'], function(){
            Route::get ('/','SurplusController@index')->name('admin.surplus.index');//首页
            Route::get ('/list','SurplusController@list')->name('admin.surplus.list');//列表
        });
        //收益记录
        Route::group(['prefix' => 'profit'], function(){
            Route::get ('/','ProfitController@index')->name('admin.profit.index');//首页
            Route::get ('/list','ProfitController@list')->name('admin.profit.list');//列表
        });


    });
});